package com.qf.service.impl;

import com.qf.dao.WifeDao;
import com.qf.entity.Wife;
import com.qf.service.WifeService;
import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * 2019/9/29
 * Administrator
 * springdata0928
 * 面向对象面向君  不负代码不负卿
 */
@Service("wifeservice")
public class WifeServiceImpl implements WifeService {
    @Resource
    private WifeDao wifeDao;

    public Wife findbywid(int wid) {
      //  return wifeDao.findByWifeid(wid);
        System.out.println("wifeid="+wid);
        return wifeDao.selectwifebyid(wid);
    }

    public Wife findbyhusname(String name) {
       // return wifeDao.findByHusband_Husname(name);
        return wifeDao.selectwifebyhusname(name);
    }

    @Transactional
    public int updateWife(String name, int wid) {
        return wifeDao.updateWife(name,wid);
    }
}
